.class public Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;
.super Landroid/widget/CursorAdapter;
.source "ViewSendGlympse.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/ViewSendGlympse;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "ContactAutoCompleteAdapter"
.end annotation


# static fields
.field private static final ms_astrMatrixColumns:[Ljava/lang/String;


# instance fields
.field private m_oContentResolver:Landroid/content/ContentResolver;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 1510
    const/4 v0, 0x6

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    .line 1511
    const-string v2, "_id"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    .line 1512
    const-string v2, "type"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    .line 1513
    const-string v2, "image"

    aput-object v2, v0, v1

    const/4 v1, 0x3

    .line 1514
    const-string v2, "label"

    aput-object v2, v0, v1

    const/4 v1, 0x4

    .line 1515
    const-string v2, "name"

    aput-object v2, v0, v1

    const/4 v1, 0x5

    .line 1516
    const-string v2, "data"

    aput-object v2, v0, v1

    .line 1509
    sput-object v0, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->ms_astrMatrixColumns:[Ljava/lang/String;

    .line 1507
    return-void
.end method

.method public constructor <init>(Landroid/content/Context;)V
    .locals 1
    .parameter "oContext"

    .prologue
    const/4 v0, 0x0

    .line 1524
    invoke-direct {p0, p1, v0}, Landroid/widget/CursorAdapter;-><init>(Landroid/content/Context;Landroid/database/Cursor;)V

    .line 1519
    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->m_oContentResolver:Landroid/content/ContentResolver;

    .line 1525
    invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->m_oContentResolver:Landroid/content/ContentResolver;

    .line 1526
    invoke-static {}, Lcom/glympse/android/glympse/ContactsHelper;->Initialize()V

    .line 1527
    return-void
.end method


# virtual methods
.method public bindView(Landroid/view/View;Landroid/content/Context;Landroid/database/Cursor;)V
    .locals 12
    .parameter "oView"
    .parameter "oContext"
    .parameter "oCursor"

    .prologue
    const/4 v11, 0x5

    const/4 v10, 0x4

    const v7, 0x7f0c0004

    const/4 v8, 0x1

    const/4 v9, 0x0

    .line 1538
    invoke-interface {p3, v8}, Landroid/database/Cursor;->getInt(I)I

    move-result v1

    .line 1539
    .local v1, nType:I
    const/4 v6, 0x2

    invoke-interface {p3, v6}, Landroid/database/Cursor;->getInt(I)I

    move-result v0

    .line 1540
    .local v0, nImage:I
    const/4 v6, 0x3

    invoke-interface {p3, v6}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 1541
    .local v4, strLabel:Ljava/lang/String;
    invoke-interface {p3, v10}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v5

    .line 1542
    .local v5, strName:Ljava/lang/String;
    invoke-interface {p3, v11}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    .line 1544
    .local v3, strData:Ljava/lang/String;
    const v6, 0x7f0c0003

    invoke-virtual {p1, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/ImageView;

    invoke-virtual {p0, v0}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 1546
    if-ne v10, v1, :cond_0

    .line 1547
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v6

    iget-object v6, v6, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    invoke-virtual {v6}, Lcom/glympse/platform/Config;->HasTwitterCredentials()Z

    move-result v6

    if-eqz v6, :cond_0

    .line 1548
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v6

    iget-object v6, v6, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v6, v6, Lcom/glympse/platform/Config;->m_strTwitterName:Ljava/lang/String;

    invoke-static {v6}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v6

    if-nez v6, :cond_0

    .line 1550
    invoke-virtual {p1, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, " ("

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v7, v7, Lcom/glympse/platform/Config;->m_strTwitterName:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ")"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p0, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 1563
    :goto_0
    const v6, 0x7f0c0005

    invoke-virtual {p1, v6}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/widget/TextView;

    .line 1564
    .local v2, oTextView:Landroid/widget/TextView;
    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 1566
    const/16 v6, 0xa

    const/16 v7, 0xa

    invoke-virtual {p1, v9, v6, v9, v7}, Landroid/view/View;->setPadding(IIII)V

    .line 1567
    const/16 v6, 0x8

    invoke-virtual {v2, v6}, Landroid/widget/TextView;->setVisibility(I)V

    .line 1575
    :goto_1
    return-void

    .line 1552
    .end local v2           #oTextView:Landroid/widget/TextView;
    :cond_0
    if-ne v11, v1, :cond_1

    .line 1553
    sget-object v6, Lcom/glympse/android/glympseservice/GlympseService;->ms_oThis:Lcom/glympse/android/glympseservice/GlympseService;

    invoke-virtual {v6}, Lcom/glympse/android/glympseservice/GlympseService;->GetFacebook()Lcom/glympse/android/glympseservice/FacebookWrapper;

    move-result-object v6

    invoke-virtual {v6}, Lcom/glympse/android/glympseservice/FacebookWrapper;->IsSignedIn()Z

    move-result v6

    if-eqz v6, :cond_1

    .line 1554
    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v6

    iget-object v6, v6, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v6, v6, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    invoke-static {v6}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v6

    if-nez v6, :cond_1

    .line 1556
    invoke-virtual {p1, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v7, " ("

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-static {}, Lcom/glympse/platform/Platform;->instance()Lcom/glympse/platform/Platform;

    move-result-object v7

    iget-object v7, v7, Lcom/glympse/platform/Platform;->m_oConfig:Lcom/glympse/platform/Config;

    iget-object v7, v7, Lcom/glympse/platform/Config;->m_strFacebookName:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, ")"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {p0, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 1560
    :cond_1
    invoke-virtual {p1, v7}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    invoke-virtual {p0, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0

    .line 1571
    .restart local v2       #oTextView:Landroid/widget/TextView;
    :cond_2
    invoke-virtual {p1, v9, v8, v9, v8}, Landroid/view/View;->setPadding(IIII)V

    .line 1572
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-static {v4}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v7

    if-eqz v7, :cond_3

    const-string v7, ""

    :goto_2
    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v2, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 1573
    invoke-virtual {v2, v9}, Landroid/widget/TextView;->setVisibility(I)V

    goto :goto_1

    .line 1572
    :cond_3
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-static {v4}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v8

    invoke-direct {v7, v8}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v8, ": "

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v7

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    goto :goto_2
.end method

.method public bridge synthetic convertToString(Landroid/database/Cursor;)Ljava/lang/CharSequence;
    .locals 1
    .parameter

    .prologue
    .line 1
    invoke-virtual {p0, p1}, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->convertToString(Landroid/database/Cursor;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public convertToString(Landroid/database/Cursor;)Ljava/lang/String;
    .locals 1
    .parameter "oCursor"

    .prologue
    .line 1580
    const/4 v0, 0x5

    invoke-interface {p1, v0}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public newView(Landroid/content/Context;Landroid/database/Cursor;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 3
    .parameter "oContext"
    .parameter "oCursor"
    .parameter "oParent"

    .prologue
    .line 1532
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f030001

    const/4 v2, 0x0

    invoke-virtual {v0, v1, p3, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    return-object v0
.end method

.method public runQueryOnBackgroundThread(Ljava/lang/CharSequence;)Landroid/database/Cursor;
    .locals 25
    .parameter "oConstraint"

    .prologue
    .line 1587
    if-eqz p1, :cond_0

    invoke-interface/range {p1 .. p1}, Ljava/lang/CharSequence;->length()I

    move-result v3

    if-gtz v3, :cond_1

    .line 1589
    :cond_0
    new-instance v3, Landroid/database/MatrixCursor;

    sget-object v4, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->ms_astrMatrixColumns:[Ljava/lang/String;

    invoke-direct {v3, v4}, Landroid/database/MatrixCursor;-><init>([Ljava/lang/String;)V

    .line 1762
    :goto_0
    return-object v3

    .line 1592
    :cond_1
    const/16 v18, 0x0

    .line 1596
    .local v18, oMatrixCursor:Landroid/database/MatrixCursor;
    :try_start_0
    invoke-interface/range {p1 .. p1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v20

    .line 1599
    .local v20, strConstraint:Ljava/lang/String;
    const-string v3, "twitter"

    move-object v0, v3

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    if-ltz v3, :cond_5

    const/4 v3, 0x1

    move v13, v3

    .line 1602
    .local v13, fShowTwitter:Z
    :goto_1
    const-string v3, "facebook"

    move-object v0, v3

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v3

    if-ltz v3, :cond_6

    const/4 v3, 0x1

    move v12, v3

    .line 1611
    .local v12, fShowFacebook:Z
    :goto_2
    const/4 v3, 0x2

    new-array v7, v3, [Ljava/lang/String;

    const/4 v3, 0x0

    .line 1612
    new-instance v4, Ljava/lang/StringBuilder;

    const/16 v5, 0x2a

    invoke-static {v5}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object v0, v4

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const/16 v5, 0x2a

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v7, v3

    const/4 v3, 0x1

    .line 1613
    new-instance v4, Ljava/lang/StringBuilder;

    const/16 v5, 0x2a

    invoke-static {v5}, Ljava/lang/String;->valueOf(C)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    move-object v0, v4

    move-object/from16 v1, v20

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    const/16 v5, 0x2a

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v7, v3

    .line 1617
    .local v7, astrWhereArgs:[Ljava/lang/String;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->m_oContentResolver:Landroid/content/ContentResolver;

    move-object v3, v0

    .line 1618
    sget-object v4, Lcom/glympse/android/glympse/ContactsHelper;->ms_uriEmail:Landroid/net/Uri;

    .line 1619
    sget-object v5, Lcom/glympse/android/glympse/ContactsHelper;->ms_astrEmailColumns:[Ljava/lang/String;

    .line 1620
    sget-object v6, Lcom/glympse/android/glympse/ContactsHelper;->ms_strWhereGlobEmail:Ljava/lang/String;

    .line 1621
    sget-object v8, Lcom/glympse/android/glympse/ContactsHelper;->ms_strOrderByEmail:Ljava/lang/String;

    .line 1617
    invoke-virtual/range {v3 .. v8}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v16

    .line 1629
    .local v16, oCursorEmails:Landroid/database/Cursor;
    move-object/from16 v0, p0

    iget-object v0, v0, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->m_oContentResolver:Landroid/content/ContentResolver;

    move-object v3, v0

    .line 1630
    sget-object v4, Lcom/glympse/android/glympse/ContactsHelper;->ms_uriPhone:Landroid/net/Uri;

    .line 1631
    sget-object v5, Lcom/glympse/android/glympse/ContactsHelper;->ms_astrPhoneColumns:[Ljava/lang/String;

    .line 1632
    sget-object v6, Lcom/glympse/android/glympse/ContactsHelper;->ms_strWhereGlobPhone:Ljava/lang/String;

    .line 1633
    sget-object v8, Lcom/glympse/android/glympse/ContactsHelper;->ms_strOrderByPhone:Ljava/lang/String;

    .line 1629
    invoke-virtual/range {v3 .. v8}, Landroid/content/ContentResolver;->query(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v17

    .line 1636
    .local v17, oCursorPhones:Landroid/database/Cursor;
    new-instance v19, Landroid/database/MatrixCursor;

    sget-object v3, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->ms_astrMatrixColumns:[Ljava/lang/String;

    invoke-interface/range {v16 .. v16}, Landroid/database/Cursor;->getCount()I

    move-result v4

    invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->getCount()I

    move-result v5

    add-int/2addr v4, v5

    if-eqz v13, :cond_7

    const/4 v5, 0x1

    :goto_3
    add-int/2addr v4, v5

    if-eqz v12, :cond_8

    const/4 v5, 0x1

    :goto_4
    add-int/2addr v4, v5

    move-object/from16 v0, v19

    move-object v1, v3

    move v2, v4

    invoke-direct {v0, v1, v2}, Landroid/database/MatrixCursor;-><init>([Ljava/lang/String;I)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 1638
    .end local v18           #oMatrixCursor:Landroid/database/MatrixCursor;
    .local v19, oMatrixCursor:Landroid/database/MatrixCursor;
    const/4 v14, 0x0

    .line 1640
    .local v14, nId:I
    if-eqz v13, :cond_2

    .line 1642
    const/4 v3, 0x6

    :try_start_1
    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    .line 1643
    add-int/lit8 v14, v14, 0x1

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 1644
    const/4 v5, 0x4

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x2

    .line 1645
    const v5, 0x7f020090

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x3

    .line 1646
    const-string v5, ""

    aput-object v5, v3, v4

    const/4 v4, 0x4

    .line 1647
    const-string v5, "Twitter"

    aput-object v5, v3, v4

    const/4 v4, 0x5

    .line 1648
    const-string v5, ""

    aput-object v5, v3, v4

    .line 1642
    move-object/from16 v0, v19

    move-object v1, v3

    invoke-virtual {v0, v1}, Landroid/database/MatrixCursor;->addRow([Ljava/lang/Object;)V

    .line 1651
    :cond_2
    if-eqz v12, :cond_3

    .line 1653
    const/4 v3, 0x6

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    .line 1654
    add-int/lit8 v14, v14, 0x1

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 1655
    const/4 v5, 0x5

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x2

    .line 1656
    const v5, 0x7f02008d

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x3

    .line 1657
    const-string v5, ""

    aput-object v5, v3, v4

    const/4 v4, 0x4

    .line 1658
    const-string v5, "Facebook"

    aput-object v5, v3, v4

    const/4 v4, 0x5

    .line 1659
    const-string v5, ""

    aput-object v5, v3, v4

    .line 1653
    move-object/from16 v0, v19

    move-object v1, v3

    invoke-virtual {v0, v1}, Landroid/database/MatrixCursor;->addRow([Ljava/lang/Object;)V

    .line 1663
    :cond_3
    if-nez v16, :cond_9

    const/4 v3, 0x0

    move v10, v3

    .line 1664
    .local v10, fMoreEmails:Z
    :goto_5
    if-nez v17, :cond_a

    const/4 v3, 0x0

    move v11, v3

    .line 1666
    .local v11, fMorePhones:Z
    :goto_6
    const/16 v22, 0x0

    .local v22, strEmailName:Ljava/lang/String;
    const/16 v24, 0x0

    .line 1669
    .local v24, strPhoneName:Ljava/lang/String;
    :goto_7
    if-nez v10, :cond_b

    if-nez v11, :cond_b

    .line 1744
    if-eqz v17, :cond_4

    .line 1746
    invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->close()V

    .line 1747
    const/16 v17, 0x0

    .line 1751
    :cond_4
    if-eqz v16, :cond_17

    .line 1753
    invoke-interface/range {v16 .. v16}, Landroid/database/Cursor;->close()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 1754
    const/16 v16, 0x0

    move-object/from16 v18, v19

    .line 1762
    .end local v7           #astrWhereArgs:[Ljava/lang/String;
    .end local v10           #fMoreEmails:Z
    .end local v11           #fMorePhones:Z
    .end local v12           #fShowFacebook:Z
    .end local v13           #fShowTwitter:Z
    .end local v14           #nId:I
    .end local v16           #oCursorEmails:Landroid/database/Cursor;
    .end local v17           #oCursorPhones:Landroid/database/Cursor;
    .end local v19           #oMatrixCursor:Landroid/database/MatrixCursor;
    .end local v20           #strConstraint:Ljava/lang/String;
    .end local v22           #strEmailName:Ljava/lang/String;
    .end local v24           #strPhoneName:Ljava/lang/String;
    .restart local v18       #oMatrixCursor:Landroid/database/MatrixCursor;
    :goto_8
    if-nez v18, :cond_16

    new-instance v3, Landroid/database/MatrixCursor;

    sget-object v4, Lcom/glympse/android/glympse/ViewSendGlympse$ContactAutoCompleteAdapter;->ms_astrMatrixColumns:[Ljava/lang/String;

    invoke-direct {v3, v4}, Landroid/database/MatrixCursor;-><init>([Ljava/lang/String;)V

    goto/16 :goto_0

    .line 1599
    .restart local v20       #strConstraint:Ljava/lang/String;
    :cond_5
    const/4 v3, 0x0

    move v13, v3

    goto/16 :goto_1

    .line 1602
    .restart local v13       #fShowTwitter:Z
    :cond_6
    const/4 v3, 0x0

    move v12, v3

    goto/16 :goto_2

    .line 1636
    .restart local v7       #astrWhereArgs:[Ljava/lang/String;
    .restart local v12       #fShowFacebook:Z
    .restart local v16       #oCursorEmails:Landroid/database/Cursor;
    .restart local v17       #oCursorPhones:Landroid/database/Cursor;
    :cond_7
    const/4 v5, 0x0

    goto/16 :goto_3

    :cond_8
    const/4 v5, 0x0

    goto/16 :goto_4

    .line 1663
    .end local v18           #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v14       #nId:I
    .restart local v19       #oMatrixCursor:Landroid/database/MatrixCursor;
    :cond_9
    :try_start_2
    invoke-interface/range {v16 .. v16}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v3

    move v10, v3

    goto :goto_5

    .line 1664
    .restart local v10       #fMoreEmails:Z
    :cond_a
    invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v3

    move v11, v3

    goto :goto_6

    .line 1672
    .restart local v11       #fMorePhones:Z
    .restart local v22       #strEmailName:Ljava/lang/String;
    .restart local v24       #strPhoneName:Ljava/lang/String;
    :cond_b
    if-eqz v10, :cond_c

    if-nez v22, :cond_c

    .line 1674
    const/4 v3, 0x0

    move-object/from16 v0, v16

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v22

    .line 1678
    :cond_c
    if-eqz v11, :cond_d

    if-nez v24, :cond_d

    .line 1680
    const/4 v3, 0x0

    move-object/from16 v0, v17

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-static {v3}, Lcom/glympse/platform/common/Helpers;->SafeStr(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v24

    .line 1685
    :cond_d
    if-eqz v11, :cond_e

    if-eqz v10, :cond_11

    move-object/from16 v0, v22

    move-object/from16 v1, v24

    invoke-virtual {v0, v1}, Ljava/lang/String;->compareToIgnoreCase(Ljava/lang/String;)I

    move-result v3

    if-gtz v3, :cond_11

    .line 1687
    :cond_e
    const/4 v3, 0x1

    move-object/from16 v0, v16

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v15

    .line 1688
    .local v15, nType:I
    const/4 v3, 0x2

    move-object/from16 v0, v16

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v23

    .line 1689
    .local v23, strLabel:Ljava/lang/String;
    const/4 v3, 0x3

    move-object/from16 v0, v16

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v21

    .line 1691
    .local v21, strData:Ljava/lang/String;
    invoke-static/range {v21 .. v21}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_10

    .line 1693
    invoke-static/range {v23 .. v23}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_f

    .line 1695
    invoke-static {v15}, Lcom/glympse/android/glympse/ContactsHelper;->GetEmailLabel(I)Ljava/lang/String;

    move-result-object v23

    .line 1698
    :cond_f
    const/4 v3, 0x6

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    .line 1699
    add-int/lit8 v14, v14, 0x1

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 1700
    const/4 v5, 0x2

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x2

    .line 1701
    const v5, 0x7f02008c

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x3

    .line 1702
    aput-object v23, v3, v4

    const/4 v4, 0x4

    .line 1703
    aput-object v22, v3, v4

    const/4 v4, 0x5

    .line 1704
    aput-object v21, v3, v4

    .line 1698
    move-object/from16 v0, v19

    move-object v1, v3

    invoke-virtual {v0, v1}, Landroid/database/MatrixCursor;->addRow([Ljava/lang/Object;)V

    .line 1708
    :cond_10
    const/16 v22, 0x0

    .line 1709
    invoke-interface/range {v16 .. v16}, Landroid/database/Cursor;->moveToNext()Z

    move-result v10

    goto/16 :goto_7

    .line 1715
    .end local v15           #nType:I
    .end local v21           #strData:Ljava/lang/String;
    .end local v23           #strLabel:Ljava/lang/String;
    :cond_11
    const/4 v3, 0x1

    move-object/from16 v0, v17

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getInt(I)I

    move-result v15

    .line 1716
    .restart local v15       #nType:I
    const/4 v3, 0x2

    move-object/from16 v0, v17

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v23

    .line 1717
    .restart local v23       #strLabel:Ljava/lang/String;
    const/4 v3, 0x3

    move-object/from16 v0, v17

    move v1, v3

    invoke-interface {v0, v1}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v21

    .line 1719
    .restart local v21       #strData:Ljava/lang/String;
    invoke-static/range {v21 .. v21}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-nez v3, :cond_13

    .line 1721
    invoke-static/range {v23 .. v23}, Lcom/glympse/platform/common/Helpers;->IsEmpty(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_12

    .line 1723
    invoke-static {v15}, Lcom/glympse/android/glympse/ContactsHelper;->GetPhoneLabel(I)Ljava/lang/String;

    move-result-object v23

    .line 1726
    :cond_12
    const/4 v3, 0x6

    new-array v3, v3, [Ljava/lang/Object;

    const/4 v4, 0x0

    .line 1727
    add-int/lit8 v14, v14, 0x1

    invoke-static {v14}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x1

    .line 1728
    const/4 v5, 0x3

    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x2

    .line 1729
    invoke-static/range {v21 .. v21}, Lcom/glympse/platform/common/Recipient;->IsTwitterNumber(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_14

    const v5, 0x7f020090

    :goto_9
    invoke-static {v5}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v5

    aput-object v5, v3, v4

    const/4 v4, 0x3

    .line 1732
    aput-object v23, v3, v4

    const/4 v4, 0x4

    .line 1733
    aput-object v24, v3, v4

    const/4 v4, 0x5

    .line 1734
    aput-object v21, v3, v4

    .line 1726
    move-object/from16 v0, v19

    move-object v1, v3

    invoke-virtual {v0, v1}, Landroid/database/MatrixCursor;->addRow([Ljava/lang/Object;)V

    .line 1738
    :cond_13
    const/16 v24, 0x0

    .line 1739
    invoke-interface/range {v17 .. v17}, Landroid/database/Cursor;->moveToNext()Z

    move-result v11

    goto/16 :goto_7

    .line 1730
    :cond_14
    invoke-static/range {v21 .. v21}, Lcom/glympse/platform/common/Recipient;->IsFacebookNumber(Ljava/lang/String;)Z
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1

    move-result v5

    if-eqz v5, :cond_15

    const v5, 0x7f02008d

    goto :goto_9

    .line 1731
    :cond_15
    const v5, 0x7f02008f

    goto :goto_9

    .line 1757
    .end local v7           #astrWhereArgs:[Ljava/lang/String;
    .end local v10           #fMoreEmails:Z
    .end local v11           #fMorePhones:Z
    .end local v12           #fShowFacebook:Z
    .end local v13           #fShowTwitter:Z
    .end local v14           #nId:I
    .end local v15           #nType:I
    .end local v16           #oCursorEmails:Landroid/database/Cursor;
    .end local v17           #oCursorPhones:Landroid/database/Cursor;
    .end local v19           #oMatrixCursor:Landroid/database/MatrixCursor;
    .end local v20           #strConstraint:Ljava/lang/String;
    .end local v21           #strData:Ljava/lang/String;
    .end local v22           #strEmailName:Ljava/lang/String;
    .end local v23           #strLabel:Ljava/lang/String;
    .end local v24           #strPhoneName:Ljava/lang/String;
    .restart local v18       #oMatrixCursor:Landroid/database/MatrixCursor;
    :catch_0
    move-exception v3

    move-object v9, v3

    .line 1759
    .local v9, e:Ljava/lang/Exception;
    :goto_a
    invoke-static {v9}, Lcom/glympse/platform/common/Helpers;->Log(Ljava/lang/Throwable;)V

    goto/16 :goto_8

    .end local v9           #e:Ljava/lang/Exception;
    :cond_16
    move-object/from16 v3, v18

    .line 1762
    goto/16 :goto_0

    .line 1757
    .end local v18           #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v7       #astrWhereArgs:[Ljava/lang/String;
    .restart local v12       #fShowFacebook:Z
    .restart local v13       #fShowTwitter:Z
    .restart local v14       #nId:I
    .restart local v16       #oCursorEmails:Landroid/database/Cursor;
    .restart local v17       #oCursorPhones:Landroid/database/Cursor;
    .restart local v19       #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v20       #strConstraint:Ljava/lang/String;
    :catch_1
    move-exception v3

    move-object v9, v3

    move-object/from16 v18, v19

    .end local v19           #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v18       #oMatrixCursor:Landroid/database/MatrixCursor;
    goto :goto_a

    .end local v18           #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v10       #fMoreEmails:Z
    .restart local v11       #fMorePhones:Z
    .restart local v19       #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v22       #strEmailName:Ljava/lang/String;
    .restart local v24       #strPhoneName:Ljava/lang/String;
    :cond_17
    move-object/from16 v18, v19

    .end local v19           #oMatrixCursor:Landroid/database/MatrixCursor;
    .restart local v18       #oMatrixCursor:Landroid/database/MatrixCursor;
    goto/16 :goto_8
.end method
